// 数组
let arr0:number[]=[1,2,3,4,5]
let arr1:(number | string)[]=[1,2,3,4,5,""]

// 元组
let arr2:[string,number]=["啥子",1]

// 枚举
enum roles{
    NB_ly=99,
    RZ_szt=101,
    F5_hxd=200
}
let role:roles=roles.F5_hxd
console.log(role)

// 接口
interface Test{
    id:number,
    name:string
}
let test:Test={
    id:1,
    name:"abcd"
}

// 函数
function func(ele1:string,ele2:string):string{
    return ele1+ele2;
}
console.log(func("a","b"));
/*------------------------*/
function f():{id:number,name:string} {
    return {
        id:1,
        name:"s1"
    }
}
console.log(f());

// 类型别名
type ID=string|number;
let otherName:ID="abcd";
type Test1={
    id:number,
    name:string
}
let test1:Test1={
    id:2,
    name:"s2"
}

// 可选属性
interface May{
    y1:string,
    y2:string,
    y3?:string
}
let may1:May={
    y1:"may1_y1",
    y2:"may1_y2",
    y3:"may1_y3"
}
let may2:May={
    y1:"may2_y1",
    y2:"may2_y2"
}
export {}